import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: "/home"
  },
  {
    path: '/about',
    // meta  路由元信息 
    // 定义在meta里面的属性 叫做自定义属性 可以供路由跳转时进行调用
    meta: {
      isFootShow: true
    },
    name: 'About',
    component: () => import('../views/About.vue')
  },
  {
    path: '/home',
    meta: {
      isFootShow: true
    },
    name: 'home',
    component: () => import('../views/home/index.vue')
  },
  {
    path: '/topic',
    meta: {
      isFootShow: true
    },
    name: 'topic',
    component: () => import('../views/topic/index.vue')
  },
  {
    path: '/category',
    meta: {
      isFootShow: true
    },
    name: 'category',
    component: () => import('../views/category/index.vue')
  },
  {
    path: '/cart',
    meta: {
      isFootShow: true
    },
    name: 'cart',
    component: () => import('../views/cart/index.vue')
  },
  {
    path: '/my',
    meta: {
      isFootShow: true
    },
    name: 'my',
    component: () => import('../views/my/index.vue')
  },
  {
    path: '/city',
    meta: {
      isFootShow: false
    },
    name: 'city',
    component: () => import('../views/home/city/index.vue')
  },
  {
    path: '/search',
    meta: {
      isFootShow: false
    },
    name: 'search',
    component: () => import('../views/home/search/index.vue')
  },
  {
    path: '/main',
    meta: {
      isFootShow: false
    },
    name: 'main',
    component: () => import('../components/main/index.vue')
  },
  {
    path: '/brand',
    meta: {
      isFootShow: false
    },
    name: 'brand',
    component: () => import('../components/brand/index.vue')
  },
  {
    path: '/detail',
    meta: {
      isFootShow: false
    },
    name: 'detail',
    component: () => import('../components/detail/index.vue')
  },
  {
    path: '/address',
    meta: {
      isFootShow: false
    },
    name: 'address',
    component: () => import('../components/address/index.vue')
  },
  {
    path: '/topicdetail',
    meta: {
      isFootShow: false
    },
    name: 'topicdetail',
    component: () => import('../components/topicdetail/index.vue')
  },
  {
    path: '/idea',
    meta: {
      isFootShow: false
    },
    name: 'idea',
    component: () => import('../components/idea/index.vue')
  },

]

const router = new VueRouter({
  routes
})

export default router
